$("#ajaxqueryapi").click(function () {
    $.ajax({
        url: 'ajax_query_api/',
        type: 'GET',
        dataType: 'JSON',
        async: false,
        data: {},
        success: function (result) {

            var list = result.api;
            //var obj = JSON.parse(list);
            var len = list.length;
            var html = [];
            for (var i = 0; i < len; i++) {
                html.push("<tr><td>" + list[i]["apitype"] + "</td>");
                html.push("<td>" + list[i]["apikey"] + "</td></tr>");
                console.log(html);
                //$("#ajaxqueryapi").empty();
                $("#tableviewapi").append(html.join(""));
                //.prop("outerHTML")
            }
        }
    })
    //$("#ajaxqueryapi").off("click");
})